<%@ page import="com.ws.utils.Res" %><%--
  Created by IntelliJ IDEA.
  User: Adminis
  Date: 2025/3/19
  Time: 11:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>路线修改</title> <!-- 修改页面标题 -->
	<link rel="stylesheet" href="${ pageContext.request.contextPath}/admin/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="${ pageContext.request.contextPath}/css/common.css"> <!-- 添加公共CSS文件引用 -->
	<script src="${ pageContext.request.contextPath}/admin/bootstrap/js/jquery-2.1.0.min.js"></script>
	<script src="${ pageContext.request.contextPath}/admin/bootstrap/js/bootstrap.min.js"></script>

</head>
<body>

<div class="container cus-container">
	<!-- 添加用户模态框 -->
	<h3 class="text-center">线路修改</h3> <!-- 修改页面标题 -->

	<form action="${pageContext.request.contextPath}/route/update" method="post" enctype="multipart/form-data"> <!-- 修改表单提交地址 -->
		<input type="hidden" name="route_id" value="${route.route_id}">
		<div class="form-group">
			<label for="route_name">线路名称:</label>
			<input type="text" class="form-control" name="route_name" id="route_name" value="${route.route_name}" placeholder="请输入线路名称" required>
		</div>
		<div class="form-group">
			<label for="route_typeId">线路类型:</label>
			<select name="categorie_id" id="route_typeId" class="form-control" required>
				<option value="">请选择线路类型</option>
				<c:forEach items="${CategorieList}" var="categorie">
					<option value="${categorie.categorie_id}" <c:if test="${route.categorie_id == categorie.categorie_id}">selected</c:if>>${categorie.categorie_name}</option>
				</c:forEach>
			</select>
		</div>
		<div class="form-group row">
			<div class="col-lg-6">
				<label for="route_start_place">线路出发地:</label>
				<input type="text" class="form-control" name="route_start_place" id="route_start_place" value="${route.route_start_place}" placeholder="请输入线路出发地" required>
			</div>
			<div class="col-lg-6">
				<label for="route_end_place">线路目的地:</label>
				<input type="text" class="form-control" name="route_end_place" id="route_end_place" value="${route.route_end_place}" placeholder="请输入线路目的地" required>
			</div>
		</div>
		<div class="form-group row">
			<div class="col-lg-6">
				<label for="route_tianShu">线路天数:</label>
				<input type="number" class="form-control" name="route_tianShu" id="route_tianShu" value="${route.route_tianShu}" placeholder="请输入线路天数" required>
			</div>
			<div class="col-lg-6">
				<label for="route_price">线路价钱:</label>
				<input type="text" class="form-control" name="route_price" id="route_price" value="${route.route_price}" placeholder="请输入线路价钱" required>
			</div>
		</div>
		<div class="form-group row">
			<div class="col-lg-6">
				<label for="route_start_date">出发时间:</label>
				<input type="date" class="form-control" name="route_start_date" id="route_start_date" value="<fmt:formatDate value="${route.create_time}" pattern="yyyy-MM-dd"/>" placeholder="请输入出发时间" required>
			</div>
		</div>
		<div class="form-group row">
			<div class="col-lg-6">
				<label for="route_themeId">主题:</label>
				<select name="theme_id" id="route_themeId" class="form-control" required>
					<option id="moren" value="">请选择主题</option>
					<c:forEach items="${ThemeList}" var="theme">
						<option value="${theme.theme_id}" <c:if test="${route.theme_id == theme.theme_id}">selected</c:if>>${theme.theme_name}</option>
					</c:forEach>
				</select>
			</div>
		</div>
		<div class="form-group row">
			<div class="col-lg-6">
				<label for="route_image">图片:</label>
				<input type="file" name="image" id="route_image" class="form-control">
				<img src="<%=Res.fileUrl%>${route.route_image}"  width="50px" height="50px">
				<input type="hidden" class="form-control" name="img" value="${route.route_image}">
			</div>
		</div>
		<div class="form-group">
			<label for="route_supplierId">供应商:</label>
			<select name="supplier_id" id="route_supplierId" class="form-control" required>
				<option>请选择供应商</option>
				<c:forEach items="${SupplierList}" var="supplier">
					<option value="${supplier.supplier_id}" <c:if test="${route.supplier_id == supplier.supplier_id}">selected</c:if>>${supplier.supplier_name}</option>
				</c:forEach>
			</select>
		</div>

		<div class="form-group">
			<label for="route_content">线路描述:</label>
			<textarea class="form-control" name="route_content" id="route_content" rows="3" placeholder="请输入线路描述" required>${route.route_content}</textarea>
		</div>
		<button type="submit" class="btn btn-primary btn-lg btn-block">修改</button> <!-- 修改提交按钮文本 -->
	</form>
</div>

</body>
</html>